package com.whiteape.book.model.dto;


import com.whiteape.book.model.bo.BaseMediaInfoBean;
import com.whiteape.book.utils.GsonUtils;

import org.greenrobot.greendao.converter.PropertyConverter;

import java.io.Serializable;
import java.util.Map;

public class SiteSourceMediaInfoBean extends BaseMediaInfoBean implements PropertyConverter<SiteSourceMediaInfoBean, String>, Serializable {


    @Override
    public SiteSourceMediaInfoBean convertToEntityProperty(String databaseValue) {
        return GsonUtils.string2Obj(databaseValue, SiteSourceMediaInfoBean.class);
    }

    @Override
    public String convertToDatabaseValue(SiteSourceMediaInfoBean entityProperty) {
        return GsonUtils.obj2String(entityProperty);
    }

    /**
     * 章节列表链接（点击之后是章节目录列表）
     */
    private String catalogUrl;

    /**
     * 章节列表如果有分页，这个是分页链接,手机wap站点一般喜欢分页
     */
    private String catalogNextPageUrl;
    /**
     * 请求头
     */
    private Map<String, String> headers;

    public Map<String, String> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    public String getCatalogUrl() {
        return catalogUrl;
    }

    public void setCatalogUrl(String catalogUrl) {
        this.catalogUrl = catalogUrl;
    }

    public String getCatalogNextPageUrl() {
        return catalogNextPageUrl;
    }

    public void setCatalogNextPageUrl(String catalogNextPageUrl) {
        this.catalogNextPageUrl = catalogNextPageUrl;
    }

    @Override
    public String toString() {
        return "SiteSourceMediaInfoBean{" +
                "catalogUrl='" + catalogUrl + '\'' +
                ", catalogNextPageUrl='" + catalogNextPageUrl + '\'' +
                '}' + super.toString();
    }
}
